import request from "@/plugin/axios";

const BASE_URL = "sys/post";

export function PostList(data) {
  return request({
    url: BASE_URL,
    method: "get",
    params: data,
  });
}

export function PostSimpleList() {
  return request({
    url: BASE_URL + "/simple",
    method: "get",
  });
}

export function PostSimpleUser(postId) {
  return request({
    url: BASE_URL + "/" + postId + "/simple/user",
    method: "get",
  });
}

export function PostAdd(data) {
  return request({
    url: BASE_URL,
    method: "post",
    data,
  });
}

export function PostUpdate(data) {
  return request({
    url: BASE_URL,
    method: "put",
    data,
  });
}

export function PostUserBatch(data) {
  return request({
    url: BASE_URL + "/user/batch",
    method: "put",
    data,
  });
}

export function PostStatusChange(postId) {
  return request({
    url: BASE_URL + "/" + postId + "/status",
    method: "put",
  });
}

export function PostDel(postId) {
  return request({
    url: BASE_URL + "/" + postId,
    method: "delete",
  });
}
